<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Check a word</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.pspell-add-to-session.html">« pspell_add_to_session</a></li>
      <li style="float: right;"><a href="function.pspell-clear-session.html">pspell_clear_session »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.pspell.html">Pspell 函数</a></li>
    <li>Check a word</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.pspell-check" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pspell_check</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pspell_check</span> &mdash; <span class="dc-title">Check a word</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pspell-check-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pspell_check</strong></span>(<span class="methodparam"><span class="type"><a href="class.pspell-dictionary.html" class="type PSpell\Dictionary">PSpell\Dictionary</a></span> <code class="parameter">$dictionary</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$word</code></span>): <span class="type">bool</span></div>

  <p class="simpara">
   <span class="function"><strong>pspell_check()</strong></span> checks the spelling of a word.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pspell-check-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">dictionary</code></dt>

     <dd>

      <p class="para">An <span class="classname"><a href="class.pspell-dictionary.html" class="classname">PSpell\Dictionary</a></span> instance.</p>
     </dd>

    
    
     <dt>
<code class="parameter">word</code></dt>

     <dd>

      <p class="para">
       The tested word.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pspell-check-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>true</code></strong> if the spelling is correct, <strong><code>false</code></strong> if not.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pspell-check-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  The <code class="parameter">dictionary</code> parameter expects an <span class="classname"><a href="class.pspell-dictionary.html" class="classname">PSpell\Dictionary</a></span>
  instance now; previously, a <a href="language.types.resource.html" class="link">资源(resource)</a> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.pspell-check-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2587">
    <p><strong>示例 #1 <span class="function"><strong>pspell_check()</strong></span> Example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$pspell&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">pspell_new</span><span style="color: #007700">(</span><span style="color: #DD0000">"en"</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">pspell_check</span><span style="color: #007700">(</span><span style="color: #0000BB">$pspell</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"testt"</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"This&nbsp;is&nbsp;a&nbsp;valid&nbsp;spelling"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Sorry,&nbsp;wrong&nbsp;spelling"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div></div></div></body></html>